#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "a8/delegate.hpp"
//#include <a8/socket.hpp>
#include <a8/closure.hpp>
//#include <a8/mysql.hpp>
#include <a8/strutils.hpp>
#include <a8/sysutils.hpp>
//#include <a8/strutils.hpp>

void test()
{
    printf("test called....\n");
}

#define MSG_DEFINE(...) \
	printf(#__VA_ARGS__); \
	printf("\n");

int main()
{
	MSG_DEFINE(adsf, 234, daf);
	return 0;
#if 0
	a8::mysql::Connection conn;
	a8::mysql::Query query(&conn);
	if(!conn.Connect("127.0.0.1", 3306, "oss_query", "123456", "game_logs")){
		printf("can't connect 127.0.0.1:3306\r\n");
	}
	int recnum = query.ExecQuery("SELECT * FROM action_record;");
	printf("recnum:%d\r\n", recnum);
	int idx = 0;
	while(!query.Eof()){
		printf("idx:%d server_id:%s account_id:%s account_name:%s remote_ip:%s\r\n", idx++, 
			   query.GetValue(0).getString().c_str(),
			   query.GetValue(1).getString().c_str(),
			   query.GetValue(2).getString().c_str(),
			   query.GetValue(3).getString().c_str());
		query.Next();
	}
#endif
	char strtime[80];

	unsigned long lastruntick = XGetTickCount();
	while(true){
		if(XGetTickCount() - lastruntick > 2500){
			time_t now = time(NULL);
			struct tm *ptr = localtime(&now);
			strftime(strtime, 80, "%F %T", ptr);
			printf("[%s]lastruntick=%d currtick=%d deltatick=%d\n", 
				   strtime, lastruntick, XGetTickCount(), 
				   XGetTickCount() - lastruntick);
			lastruntick = XGetTickCount();
		}
		usleep(10);
	}
    return 0;
}
